﻿using VisualWip.Core.Interfaces;
using VisualWip.Core.SlotsProviders;

namespace VisualWip.Core.Columns
{
    public class WorkDoingColumn : WorkDualQueryColumnBase
    {
        public WorkDoingColumn(IWorkItemProviderFactory workItemProviderFactory)
            : base(workItemProviderFactory)
        {
            SlotsProvider = new SlotsProvider(true);
            ColumnType = ColumnType.Processing;
        }

        public override IQuery Query
        {
            get { return FirstQuery; }
        }

        public override int GetWorkInProgressLimit()
        {
            return WorkInProgressLimitCalculator.DualQueries(TotalWorkInProgressLimit,
                                                             FirstColumnWorkCount(), SecondColumnWorkCount()).Item1;
        }
    }
}